﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IRCServer.Utilities
{
    public enum CommandType
    {
        SERVER,
        QUIT,
        SPRIVMSG,
        ADDUSER,
        REMOVEUSER
    };

    public class CommandGenerator
    {
        private const string SERVERCommand = "SERVER {0} {1}";
        private const string QUITCommand = "QUIT :{0}";
        private const string ADDUSERCommand = "ADDUSER {0}";
        private const string REMOVEUSERCommand = "REMOVEUSER {0}";

        public static string GenerateCommand(CommandType type, params string[] values)
        {
            switch (type)
            {
                case CommandType.SERVER:
                    return string.Format(SERVERCommand, values);
                case CommandType.QUIT:
                    return string.Format(QUITCommand, values);
                case CommandType.ADDUSER:
                    return string.Format(ADDUSERCommand, values);
                case CommandType.REMOVEUSER:
                    return string.Format(REMOVEUSERCommand, values);
            }

            return string.Empty;
        }
    }
}
